From: Eric P. <pe...@cg...> - 2007-04-07 00:28:54
|
On Apr 6, 2007, at 5:11 AM, Dean N. Williams wrote: > Hi Eric, > > the gui_control.Command(), just allows me to pass arguments > easier.... > > -Dean Perhaps I should have phrased my first mail differently. Don't both pack() and grid() widgets -- it will lead to weird bugs where both geometry managers are fighting to position your widgets. You are using the function returned by gui_control.Command() as your 'raisecommand' function for tabs. What does that function do? > > #--------------------------------------------------------------------- > -- > ---------- > # Event handling function that will allow the passing of arguments > #--------------------------------------------------------------------- > -- > ---------- > class Command: > def __init__(self, func, *args, **kw): > self.func = func > self.args = args > self.kw = kw > > def __call__(self, *args, **kw): > args = self.args + args > kw.update(self.kw) > return apply(self.func, args, kw) > > On Apr 5, 2007, at 4:12 PM, Eric Pettersen wrote: > >> Certainly some interesting things there in your code. Why are you >> both packing and gridding widgets? What does the function returned >> by gui_control.Command() do? >> >> --Eric >> >> Eric Pettersen >> UCSF Computer Graphics Lab >> >> On Apr 5, 2007, at 8:08 AM, Dean N. Williams wrote: >> >>> Dear Pmw and Tkinter communities, >>> >>> I have a Tkinter frame that is a container for an X11R6 canvas. >>> Below the canvas is a Pmw notebook. When I resize the window >>> containing the canvas and Pmw notebook, they both resize >>> appropriately and everything looks right. But when I select a tab in >>> the notebook (that is not displayed in front), the notebook and >>> canvas slightly re-adjusts making the canvas smaller or larger. How >>> can I stop the notebook and canvas from slightly adjusting itself >>> after a resize? After the resize, I tried an "update()" and >>> "update_idletask()", but the notebook still adjusted itself when I >>> select another tab. >>> >>> Any help on this is greatly appreciated. >>> >>> Best regards, >>> Dean >>> >>> On Mar 12, 2007, at 5:11 AM, Dean N. Williams wrote: >>> >>>> >>>> bigframe = Tkinter.Frame(parent ) >>>> bigframe.pack(side='top', fill = 'both', expand=1) >>>> bigframe.grid_rowconfigure(10, weight=1) >>>> bigframe.grid_columnconfigure(1, weight=1) >>>> >>>> # Create the canvas >>>> self.frame = Tkinter.Frame(bigframe, container=True, >>>> width=767, height=582) >>>> self.frame.grid(column=0, row=0, rowspan=8, sticky='nsew') >>>> self.frame.pack(side='top', fill='both', expand=1) >>>> >>>> # Create the notebook >>>> self.notebook = Pmw.NoteBook(bigframe,raisecommand = >>>> gui_control.Command(self.evt_tab, parent, canvas)) >>>> self.notebook.grid(column=0, row=9, rowspan=2, >>>> sticky='nsew') >>>> self.notebook.pack(fill = 'both', expand = 1, padx = 3, >>>> pady = 3) >>>> >>> >>> -------------------------------------------------------------------- >>> - >>> ---- >>> Take Surveys. Earn Cash. Influence the Future of IT >>> Join SourceForge.net's Techsay panel and you'll get the chance to >>> share your >>> opinions on IT & business topics through brief surveys-and earn cash >>> http://www.techsay.com/default.php? >>> page=join.php&p=sourceforge&CID=DEVDEV >>> _______________________________________________ >>> Pmw-general mailing list >>> Pmw...@li... >>> https://lists.sourceforge.net/lists/listinfo/pmw-general > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Pmw-general mailing list > Pmw...@li... > https://lists.sourceforge.net/lists/listinfo/pmw-general |